let target = 7, nums = [2, 3, 1, 2, 4, 3]
var minSubArrayLen = function (target, nums) {
    if (nums.length === 0) {
        return 0
    }
    let left = 0
    let minLength = Infinity
    let sum = 0
    for (let i = 0; i < nums.length; i++) {
        sum += nums[i]
        while (sum >= target) {
            minLength = Math.min(minLength, i - left + 1)
            sum = sum - nums[left]
            left++
        }
    }
    return minLength === Infinity ? 0 : minLength
}